@extends('admin.readLayout')
@section('title','支付详情')
@section('content')
    <blockquote class="layui-elem-quote">支付详情</blockquote>

    <div class="layui-colla-content layui-show">
        <p>支付金额：￥{{number_format($model->price,2)}}</p>
        <p>支付时间：{{$model->created_at->format('Y-m-d H:i:s')}}</p>
    </div>

    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>套餐</legend>
        <div class="layui-field-box">
            <div class="layui-collapse">
                <div class="layui-colla-item">
                    <h2 class="layui-colla-title">套餐名称：{{$model->combo->title}}</h2>
                    <div class="layui-colla-content layui-show">
                        <p>套餐价格：￥{{number_format($model->combo->price,2)}}</p>
                        <p>套餐价值：{{$model->combo->times}}{{config('wallet.unit.spots')}}</p>
                        <p>返利方式：{{\App\Http\Controllers\Admin\Business\Service\Combo::getRateTypeList()[$model->combo->rate_type]}}</p>
                        <p>返利比率：
                                    上级：{{$model->combo->rate_type==$rate_type_user?$model->combo->rate:$sysRate['rate']}}%

                                    顶级：{{$model->combo->rate_type==$rate_type_user?$model->combo->top_rate:$sysRate['top_rate']}}%
                        </p>
                    </div>
                </div>
            </div>
        </div>
    </fieldset>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>用户</legend>
        <div class="layui-field-box">
            <div class="layui-collapse">
                <div class="layui-colla-item">
                    <h2 class="layui-colla-title">用户名：{{$model->member->nickname}}</h2>
                    <div class="layui-colla-content layui-show">
                        @if(isset($model->member))
                            <p>推广人：{{$model->member->parent->nickname}}</p>
                        @endif
                        <p>手机号：{{$model->member->mobile}}</p>
                    </div>
                </div>
            </div>
        </div>
    </fieldset>
    @if($model->activity)
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>参与活动</legend>
        <div class="layui-field-box">
            <div class="layui-collapse">
                <div class="layui-colla-item">
                    <h2 class="layui-colla-title">活动名称：{{$model->activity->title}}</h2>
                    <div class="layui-colla-content layui-show">
                        <p>返利方式：{{\App\Http\Controllers\Admin\Business\Service\ComboActivities::getRateTypeList()[$model->activity->rate_type]}}</p>
                        <p>返利比率：
                            @if($model->activity->rate_type==$rate_type_user)
                                上级：{{$model->activity->rate_type}}%
                                顶级：{{$model->activity->top_rate}}%
                            @else
                                @if($model->activity->combo->rate_typee==$rate_type_user)
                                    上级：{{$model->activity->combo->rate_type}}%
                                    顶级：{{$model->activity->combo->top_rate}}%
                                @else
                                    上级：{{$sysRateAct['rate']}}%
                                    顶级：{{$sysRateAct['top_rate']}}%
                                @endif
                            @endif
                        </p>
                        <p>活动方式：{{\App\Http\Controllers\Admin\Business\Service\ComboActivities::getTypeList()[$model->activity->type]}}</p>
                        <p>@if($model->activity->type==$reduce_type)减免数额：￥{{$model->activity->reduce}}@else折扣：{{$model->activity->rebate}}%@endif</p>
                    </div>
                </div>
            </div>
        </div>
    </fieldset>
    @endif
@endsection
@section('script')
    <script>
        //注意：折叠面板 依赖 element 模块，否则无法进行功能性操作
        layui.use('element', function(){
            var element = layui.element;

            //…
        });
    </script>
@endsection